﻿using System;
using System.ComponentModel;

namespace RiskMan.DataClass.Models.Quik
{
    /// <summary>
    /// Таблица квик - таблица текущих параметров
    /// </summary>
    public class CurrentParamModel : INotifyPropertyChanged
    {
        private String _seccode;
        private String _classCode;
        private int _accurasy;
        private Double _stepPrice;
        private Double _maxPrice;
        private Double _minPrice;
        private Double _lastPrice;
        private int _quantity;
        private Double _closePrice;
        private Double _goSell;
        private Double _goBuy;
        private Double _stepPricet;
        private Double _offer;
        private Double _bid;
        private int _daystoMatDate;
        private string _optionBase ;
        private Double _exchPay;
        private Double _bgonp ;
        private Double _bgop;
        private Double _volatility;
        private DateTime _matDate;
        private DateTime _tradeDateCode;
        private string _optionKind;
        private Double _settlePrice;
        private string _tradingStatus;
        private Double _theorPrice;
        private string _optionType;
        private Double _strike;

        //опционы
        private double _gamma;
        private double _delta;

        #region public
        /// <summary>
        /// код бамаги
        /// </summary>
        public String Seccode
        {
            get { return _seccode; }
            set
            {
                if (_seccode != value)
                {
                    _seccode = value;
                    RaisePropertyChanged("Seccode");
                }
            }
        }

        /// <summary>
        /// класс бумаги
        /// </summary>
        public String ClassCode
        {
            get { return _classCode; }
            set
            {
                if (_classCode != value)
                {
                    _classCode = value;
                    RaisePropertyChanged("ClassCode");
                }
            }
        }

        /// <summary>
        /// Точность
        /// </summary>
        public int Accurasy
        {
            get { return _accurasy; }
            set
            {
                if (_accurasy != value)
                {
                    _accurasy = value;
                    RaisePropertyChanged("Accurasy");
                }
            }
        }

        /// <summary>
        /// Шаг цены 
        /// </summary>
        public Double StepPrice
        {
            get { return _stepPrice; }
            set
            {
                if (_stepPrice != value)
                {
                    _stepPrice = value;
                    RaisePropertyChanged("StepPrice");
                }
            }
        }

        /// <summary>
        /// максимально возможная цена 
        /// </summary>
        public Double MaxPrice
        {
            get { return _maxPrice; }
            set
            {
                if (_maxPrice != value)
                {
                    _maxPrice = value;
                    RaisePropertyChanged("MaxPrice");
                }
            }
        }

        /// <summary>
        /// минимально возможная цена
        /// </summary>
        public Double MinPrice
        {
            get { return _minPrice; }
            set
            {
                if (_minPrice != value)
                {
                    _minPrice = value;
                    RaisePropertyChanged("MinPrice");
                }
            }
        }

        /// <summary>
        /// цена последней сделки
        /// </summary>
        public Double LastPrice
        {
            get { return _lastPrice; }
            set
            {
                if (_lastPrice != value)
                {
                    _lastPrice = value;
                    RaisePropertyChanged("LastPrice");
                }
            }
        }

        /// <summary>
        /// Лот
        /// </summary>
        public int Quantity
        {
            get { return _quantity; }
            set
            {
                if (_quantity != value)
                {
                    _quantity = value;
                    RaisePropertyChanged("Quantity");
                }
            }
        }

        /// <summary>
        /// Цена закрытия
        /// </summary>
        public Double ClosePrice
        {
            get { return _closePrice; }
            set
            {
                if (_closePrice != value)
                {
                    _closePrice = value;
                    RaisePropertyChanged("ClosePrice");
                }
            }
        }

        /// <summary>
        /// го продавца
        /// </summary>
        public Double GoSell
        {
            get { return _goSell; }
            set
            {
                if (_goSell != value)
                {
                    _goSell = value;
                    RaisePropertyChanged("GoSell");
                }
            }
        }

        /// <summary>
        /// го покупателя
        /// </summary>
        public Double GoBuy
        {
            get { return _goBuy; }
            set
            {
                if (_goBuy != value)
                {
                    _goBuy = value;
                    RaisePropertyChanged("GoBuy");
                }
            }
        }

        /// <summary>
        /// стоимость шага цены
        /// </summary>
        public Double StepPricet
        {
            get { return _stepPricet; }
            set
            {
                if (_stepPricet != value)
                {
                    _stepPricet = value;
                    RaisePropertyChanged("StepPricet");
                }
            }
        }

        /// <summary>
        /// Предложение
        /// </summary>
        public Double Offer
        {
            get { return _offer; }
            set
            {
                if (_offer != value)
                {
                    _offer = value;
                    RaisePropertyChanged("Offer");
                }
            }
        }

        /// <summary>
        /// Спрос
        /// </summary>
        public Double Bid
        {
            get { return _bid; }
            set
            {
                if (_bid != value)
                {
                    _bid = value;
                    RaisePropertyChanged("Bid");
                }
            }
        }

        /// <summary>
        /// Дней до экспирации
        /// </summary>
        public int DaystoMatDate
        {
            get { return _daystoMatDate; }
            set
            {
                if (_daystoMatDate != value)
                {
                    _daystoMatDate = value;
                    RaisePropertyChanged("DaystoMatDate");
                }
            }
        }

        /// <summary>
        /// Базовый аквтив
        /// </summary>
        public string OptionBase
        {
            get { return _optionBase; }
            set
            {
                if (_optionBase != value)
                {
                    _optionBase = value;
                    RaisePropertyChanged("OptionBase");
                }
            }
        }

        /// <summary>
        /// Биржевой сбор
        /// </summary>
        public Double ExchPay
        {
            get { return _exchPay; }
            set
            {
                if (_exchPay != value)
                {
                    _exchPay = value;
                    RaisePropertyChanged("ExchPay");
                }
            }
        }

        /// <summary>
        /// БГОНП
        /// </summary>
        public Double Bgonp
        {
            get { return _bgonp; }
            set
            {
                if (_bgonp != value)
                {
                    _bgonp = value;
                    RaisePropertyChanged("Bgonp");
                }
            }
        }

        /// <summary>
        /// БГОП
        /// </summary>
        public Double Bgop
        {
            get { return _bgop; }
            set
            {
                if (_bgop != value)
                {
                    _bgop = value;
                    RaisePropertyChanged("Bgop");
                }
            }
        }

        /// <summary>
        /// Волатильность
        /// </summary>
        public Double Volatility
        {
            get { return _volatility; }
            set
            {
                if (_volatility != value)
                {
                    _volatility = value;
                    RaisePropertyChanged("Volatility");
                }
            }
        }

        /// <summary>
        /// Дата экспирации
        /// </summary>
        public DateTime MatDate
        {
            get { return _matDate; }
            set
            {
                if (_matDate != value)
                {
                    _matDate = value;
                    RaisePropertyChanged("MatDate");
                }
            }
        }

        /// <summary>
        /// Дата торгов
        /// </summary>
        public DateTime TradeDateCode
        {
            get { return _tradeDateCode; }
            set
            {
                if (_tradeDateCode != value)
                {
                    _tradeDateCode = value;
                    RaisePropertyChanged("TradeDateCode");
                }
            }
        }

        /// <summary>
        /// Вид опциона
        /// </summary>
        public string OptionKind
        {
            get { return _optionKind; }
            set
            {
                if (_optionKind != value)
                {
                    _optionKind = value;
                    RaisePropertyChanged("OptionKind");
                }
            }
        }

        /// <summary>
        /// Расчетная цена
        /// </summary>
        public Double SettlePrice
        {
            get { return _settlePrice; }
            set
            {
                if (_settlePrice != value)
                {
                    _settlePrice = value;
                    RaisePropertyChanged("SettlePrice");
                }
            }
        }

        /// <summary>
        /// Статус сессии
        /// </summary>
        public string TradingStatus
        {
            get { return _tradingStatus; }
            set
            {
                if (_tradingStatus != value)
                {
                    _tradingStatus = value;
                    RaisePropertyChanged("TradingStatus");
                }
            }
        }

        /// <summary>
        /// Теоретическая цена
        /// </summary>
        public Double TheorPrice
        {
            get { return _theorPrice; }
            set
            {
                if (_theorPrice != value)
                {
                    _theorPrice = value;
                    RaisePropertyChanged("TheorPrice");
                }
            }
        }

        /// <summary>
        /// Тип опциона
        /// </summary>
        public string OptionType
        {
            get { return _optionType; }
            set
            {
                if (_optionType != value)
                {
                    _optionType = value;
                    RaisePropertyChanged("OptionType");
                }
            }
        }

        /// <summary>
        /// Страйк опциона
        /// </summary>
        public Double Strike
        {
            get { return _strike; }
            set
            {
                if (_strike != value)
                {
                    _strike = value;
                    RaisePropertyChanged("Strike");
                }
            }
        }

        /// <summary>
        /// Гамма
        /// </summary>
        public double Gamma
        {
            get { return _gamma; }
            set
            {
                if (_gamma != value)
                {
                    _gamma = value;
                    RaisePropertyChanged("Gamma");
                }
            }
        }

        /// <summary>
        /// Дельта
        /// </summary>
        public double Delta
        {
            get { return _delta; }
            set
            {
                if (_delta != value)
                {
                    _delta = value;
                    RaisePropertyChanged("Delta");
                }
            }
        }

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
